package top.buyibuyi.course.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.buyibuyi.course.R;
import top.buyibuyi.course.pojo.ChooseCourse;
import top.buyibuyi.course.service.SelectTeacherCourseService;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/course")
public class SelectTeacherCourseController {

    @Autowired
    private SelectTeacherCourseService selectTeacherCourseService;

    @GetMapping("/selectTeacherCourse/{ajobn}")
    public R selectTeacherCourse(@PathVariable int ajobn){
        System.out.println(ajobn);
        List<ChooseCourse> chooseCourses = selectTeacherCourseService.selectChooseCourseByAjobn(ajobn);
        System.out.println(chooseCourses);
        return R.ok().data("data",chooseCourses);
    }
}
